package com.ada.meilisearch;
import com.meilisearch.sdk.*;
import com.meilisearch.sdk.exceptions.MeilisearchException;
import com.meilisearch.sdk.model.SearchResult;
import jodd.io.FileUtil;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
public class App {

    public static void main(String[] args) throws MeilisearchException, IOException {
        String moviesJson =  FileUtil.readString(new File("D:\\movies.json"));


        Client client = new Client(new Config("http://localhost:7700", "coMllgOZN2Kk5hK0vtbf6sCn8GtqFojjrcDKeR0zN14"));
        Index index = client.index("test");
        index.addDocuments(moviesJson);
        SearchResult res = client.index("movies").search("botman");
        System.out.println(res);
    }
}
